Add a reftest for grid layouts
authorMatthias Clasen <mclasen@redhat.com>
Mon, 24 Aug 2020 15:38:00 +0000 (11:38 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 24 Aug 2020 15:38:00 +0000 (11:38 -0400)
This tests that invisible children don't influence
the layout.

testsuite/reftests/gridlayout-invisible-child.ref.ui [new file with mode: 0644]
testsuite/reftests/gridlayout-invisible-child.ui [new file with mode: 0644]
testsuite/reftests/meson.build

diff --git a/testsuite/reftests/gridlayout-invisible-child.ref.ui b/testsuite/reftests/gridlayout-invisible-child.ref.ui
new file mode 100644 (file)
index 0000000..ad64be9
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow" id="window_information_collection">
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkGrid" id="grid1">
+        <child>
+          <object class="GtkLabel" id="label1">
+            <property name="label" translatable="yes">Hello</property>
+            <layout>
+              <property name="row">0</property>
+              <property name="column">0</property>
+            </layout>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label3">
+            <property name="label" translatable="yes">World</property>
+            <layout>
+              <property name="row">0</property>
+              <property name="column">2</property>
+            </layout>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/gridlayout-invisible-child.ui b/testsuite/reftests/gridlayout-invisible-child.ui
new file mode 100644 (file)
index 0000000..eeebd7a
--- /dev/null
@@ -0,0 +1,39 @@
+<!-- check that an invisible child does not influence the layout -->
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow" id="window_information_collection">
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkGrid" id="grid1">
+        <child>
+          <object class="GtkLabel" id="label1">
+            <property name="label" translatable="yes">Hello</property>
+            <layout>
+              <property name="row">0</property>
+              <property name="column">0</property>
+            </layout>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label2">
+            <property name="visible">0</property>
+            <property name="label" translatable="yes">cruel</property>
+            <layout>
+              <property name="row">0</property>
+              <property name="column">1</property>
+            </layout>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label3">
+            <property name="label" translatable="yes">World</property>
+            <layout>
+              <property name="row">0</property>
+              <property name="column">2</property>
+            </layout>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
index 001baa6fb632ab5781066c6b63ab2576fcdb39c4..a6a5210a773e30e1a1d9df7220c25e5683bb705f 100644 (file)
@@ -229,6 +229,8 @@ testdata = [
   'gradient-hard-stop.ref.ui',
   'gradient-hard-stop.ui',
   'green-20x20.png',
+  'gridlayout-invisible-child.ref.ui',
+  'gridlayout-invisible-child.ui',
   'grid-empty-with-spacing.ref.ui',
   'grid-empty-with-spacing.ui',
   'grid-expand.css',